/**
 * 
 */
package yanivosher.aiproject;

import java.util.Scanner;

/**
 * @author Yanivl1
 * 
 */
public class HumanAgent extends Agent {

	public HumanAgent(HumanAgent agent) {
		super(agent);
	}
	
	public HumanAgent(Vertex currentVertex, Vertex destinationVertex, int id) {
		super(currentVertex, destinationVertex, id);
	}

	public Step makeAmove(Graph curr) {
		Step step = new Step();
		Scanner sc = new Scanner(System.in);

		System.out.println("Select destination vertex:\n");
		for (Vertex v : getAvailableEdges()) {
			System.out.print(v.getId() + ",");
		}
	    String dest = sc.next();  
	    step.destination = Environment.getInstance().graph.getVertexById(dest);

	    if (currentVertex.getMilitary() > 0) {
			System.out.println("Select military scout: ");
		    step.military = 1 == sc.nextInt() ? true : false;
		}
	    else{
	    	step.military = false;
	    }

	    if (currentVertex.getChem() > 0) {
			System.out.println("Select chem scout: ");
		    step.chem = 1 == sc.nextInt() ? true : false;
		}
	    else{
	    	step.chem = false;
	    }
	    
	    step.current = this.currentVertex;
		return step;
	}

	@Override
	public boolean idDone() {
		return false;
	}

	@Override
	public HumanAgent deepCopy() {
		return new HumanAgent(this);
	}
}
